/*
 *  Copyright 2010 Yuri Kanivets
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.lepu.app.main.adapter;

import java.util.ArrayList;

import com.core.lib.ui.wheel.WheelAdapter;
import com.lepu.app.main.bean.BeanArea;

/**
 * Numeric Wheel adapter.
 */
public class ProvinceWheelAdapter implements WheelAdapter {

	/** The default min value */
	public static final ArrayList<BeanArea> strDefault=new ArrayList<BeanArea>();

	/** The default max value */

	// Values
	private ArrayList<BeanArea> str;

	// format
	@SuppressWarnings("unused")
	private String format;

	/**
	 * Default constructor
	 */
	public ProvinceWheelAdapter() {
		this(strDefault);
	}

	/**
	 * Constructor
	 * 
	 * @param minValue
	 *            the wheel min value
	 * @param maxValue
	 *            the wheel max value
	 */
	public ProvinceWheelAdapter(ArrayList<BeanArea> str) {
		this(str, null);
	}

	/**
	 * Constructor
	 * 
	 * @param minValue
	 *            the wheel min value
	 * @param maxValue
	 *            the wheel max value
	 * @param format
	 *            the format string
	 */
	public ProvinceWheelAdapter(ArrayList<BeanArea> strs, String format) {
		this.str = strs;
		this.format = format;
	}

	@Override
	public String getItem(int index) {
		
		return str.get(index).Name;
	}

	@Override
	public int getItemsCount() {
		return str.size();
	}

	@Override
	public int getMaximumLength() {

		return 6;
	}
}
